#if !defined(AFX_MANUALMODE_H__B2E522BE_B413_4DF8_BE43_014B5E068F8D__INCLUDED_)
#define AFX_MANUALMODE_H__B2E522BE_B413_4DF8_BE43_014B5E068F8D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ManualMode.h : header file
//
#define		MAN_MSG_LEN		256
/////////////////////////////////////////////////////////////////////////////
// ManualMode dialog

class ManualMode : public CDialog
{
// Construction
public:
	ManualMode(CWnd* pParent = NULL);   // standard constructor

	int				m_loggedUser;
	int				m_MovSelected;
	int				m_vx;
	int				m_vy;
	int				m_refMast;

	bool			m_MovInProg;
	bool			m_onCell;
	bool			m_begin;
	bool			m_falvlMounted;
	bool			m_dimpMounted;

	TCHAR			m_msg[MAN_MSG_LEN];

	float			start_1;

	float			m_Bridge_pos;
	float			m_Trolley_pos;
	float			m_MM_pos;
	float			m_Clus_pos;
	float			m_MMR_pos;
	float			m_TV_pos;
	float			m_TVR_pos;

	float			m_Bridge_sp;
	float			m_Trolley_sp;
	float			m_MMR_sp;
	float			m_MM_sp;
	float			m_Clus_sp;
	float			m_TV_sp;
	float			m_TVR_sp;
	float			m_x_off;
	float			m_y_off;

	HICON			m_iconOK;
	HICON			m_iconWRN;
	HICON			m_iconERR;

	HCURSOR			m_curNormal;
	HCURSOR			m_curHour;

	CBitmap			m_bmpRed;
	CBitmap			m_bmpGreen;
	CBitmap			m_bmpGray;

	OBJTMM			m_mastSituation;
	OBJTCELL		m_cellSituation;
	TCHAR			m_valStr[64];

	bool SetControls(void);
	bool CheckUser(void);
	bool LoadSP(void);
	bool LoadMreq(void);
	bool LoadParam(void);
	bool LoadMast(void);
	bool LoadCell(void);
	bool LoadLimits(void);
	int	CheckSp(float sp, float pos, float ll, float hl);
	int CheckSpMMRot(float sp, float pos, float ll, float hl);
	void InsertMessage(int type, TCHAR msg[MAN_MSG_LEN]);
	void IsReady(void);
	void UnselectMov(void);
	void _UpdateData(int updateType);
	bool CheckTrip(void);
	void ReadFloatPos(void);
	void SetBmp(void);

	LRESULT OnMastChanged(WPARAM wParam, LPARAM lParam );
	LRESULT OnCellChanged(WPARAM wParam, LPARAM lParam );
	LRESULT OnSpChanged(WPARAM wParam, LPARAM lParam );
// Dialog Data
	//{{AFX_DATA(ManualMode)
	enum { IDD = IDD_MANUAL };
	CButton	m_bMntDimp;
	CButton	m_bMntFALV;
	CButton	m_bMmtTVM;
	CButton	m_bMntMM;
	CComboBox	m_cmbFALVL_sp;
	CStatic	m_DIMPMtnRect;
	CStatic	m_MMMtnRect;
	CStatic	m_TVMtnRect;
	CStatic	m_FALVMtnRect;
	CButton	m_btnMMDispl;
	CButton	m_btnTVRot;
	CButton	m_btnMMClus;
	CButton	m_btnTV;
	CButton	m_btnTrolley;
	CButton	m_btnMM;
	CButton	m_btnMMRot;
	CButton	m_btnMMFix;
	CButton	m_btnFALVL;
	CButton	m_btnBridge;
	CStatic	m_rectFalv;
	CStatic	m_rectDispl;
	CStatic	m_rectTvRot;
	CStatic	m_rectClus;
	CStatic	m_rectFAGRL;
	CStatic	m_rectFAGR;
	CStatic	m_rectTV;
	CStatic	m_rectTrolley;
	CStatic	m_rectMMRot;
	CStatic	m_rectBridge;
	CComboBox	m_cmbMMDispl;
	CEdit	m_sysTime;
	CEdit	m_MMClus_LL_c;
	CEdit	m_MMClus_HL_c;
	CButton	m_btnDBOp;
	CButton	m_btnResetTrip;
	CEdit	m_MM_sp_rc;
	CEdit	m_MMR_sp_rc;
	CEdit	m_Clus_sp_rc;
	CEdit	m_TV_sp_rc;
	CEdit	m_TVR_sp_rc;
	CEdit	m_Trolley_sp_rc;
	CEdit	m_Bridge_sp_rc;
	CStatic	m_txtDescr_c;
	CEdit	m_txtZone_c;
	CEdit	m_txtVirtCoo_c;
	CEdit	m_txtUser_c;
	CStatic	m_txtDate_c;
	CEdit	m_TVR_LL_c;
	CEdit	m_TVR_HL_c;
	CEdit	m_TV_pos_LL_c;
	CEdit	m_TV_pos_HL_c;
	CEdit	m_TV_pos_c;
	CEdit	m_TVR_pos_c;
	CStatic	m_txtStatus_c;
	CEdit	m_Trolley_pos_c;
	CEdit	m_Bridge_pos_c;
	CEdit	m_txtOpMode_c;
	CEdit	m_MMR_LL_c;
	CEdit	m_MMR_HL_c;
	CEdit	m_MM_pos_c;
	CEdit	m_MM_pos_LL_c;
	CEdit	m_MM_pos_HL_c;
	CEdit	m_MMFixSp_c;
	CEdit	m_MM_fix_pos_c;
	CEdit	m_Clus_pos_c;
	CEdit	m_MMR_pos_c;
	CEdit	m_Trolley_pos_LL_c;
	CEdit	m_Bridge_pos_LL_c;
	CEdit	m_Trolley_pos_HL_c;
	CEdit	m_Bridge_pos_HL_c;
	CStatic	m_cellInfo_c;
	CEdit	m_TV_sp_c;
	CEdit	m_TVR_sp_c;
	CEdit	m_Trolley_sp_c;
	CEdit	m_Bridge_sp_c;
	CEdit	m_MM_sp_c;
	CEdit	m_Clus_sp_c;
	CEdit	m_MMR_sp_c;
	CStatic	m_msgIcon;
	CListCtrl	m_lstMast;
	CListCtrl	m_lstCell;
	CComboBox	m_cmb_MMFix_sp;
	CProgressCtrl	m_progMov;
	CButton	m_btnStop;
	CButton	m_btnExit;
	CButton	m_btnExe;
	CString	m_cellInfo;
	CString	m_txtUser;
	CString	m_txtZone;
	CString	m_txtVirtCoo;
	CString	m_txtOpMode;
	CString	m_MM_fix_pos;
	CString	m_txtDescr;
	CString	m_txtStatus;
	CString	m_txtDate;
	CString	m_MMFixSp;
	CString	m_Bridge_v;
	CString	m_MMClus_v;
	CString	m_MMFix_v;
	CString	m_MM_v;
	CString	m_Trolley_v;
	CString	m_TV_v;
	CString	m_TVR_dir;
	CString	m_wgCl_act;
	CString	m_wgCl_exp;
	CString	m_wgMM_act;
	CString	m_wgMM_exp;
	CString	m_sysStatus;
	CString	m_displ_A;
	CString	m_displ_B;
	CString	m_MMDisp_pos;
	CString	m_MMDisp_dir;
	CString	m_MMDisp_sp;
	CString	m_FalvPos;
	CString	m_FALVL_sp;
	//}}AFX_DATA


// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(ManualMode)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(ManualMode)
	virtual BOOL OnInitDialog();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnExe();
	afx_msg void OnStop();
	afx_msg void OnExit();
	afx_msg void OnAck();
	afx_msg void OnResetTrip();
	afx_msg void OnBtnDbop();
	afx_msg void OnClose();
	afx_msg void OnDestroy();
	afx_msg void OnDummy();
	afx_msg void OnSelchangeCmbFixSp();
	afx_msg void OnSelchangeCmbDispl();
	afx_msg void OnBtnRefresh();
	afx_msg void OnBridgeSel();
	afx_msg void OnTrolleySel();
	afx_msg void OnMmRotSel();
	afx_msg void OnMmSel();
	afx_msg void OnMmFixSel();
	afx_msg void OnMmClusSel();
	afx_msg void OnTvRotSel();
	afx_msg void OnTvSel();
	afx_msg void OnDisplSel();
	afx_msg void OnFalvlSel();
	afx_msg void OnMntMm();
	afx_msg void OnMntTvm();
	afx_msg void OnMntFalv();
	afx_msg void OnMntDimp();
	afx_msg void OnSelchangeCmbFalv();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MANUALMODE_H__B2E522BE_B413_4DF8_BE43_014B5E068F8D__INCLUDED_)
